package com.ask.apiLake;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("httpServlet")
public class httpServletController {
    @GetMapping("/api1")
    public String api1(HttpServletResponse response) {
        response.setStatus(666);
        response.addCookie(new Cookie("name", "ask"));
        return "set status and add cookie";
    }
}
